<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>购物车</title>
    <link href="/hyt/css/hyt_gwc.css" rel="stylesheet" type="text/css">
    <script src="hyt/js/hm.js"></script>
    <script src="hyt/js/jquery-1.min.js"></script>

</head>
<body>
<script type="text/javascript" src="hyt/js/AddFavorite.js"></script>
<script type="text/javascript" defer="true">

    function decamount(cartItemId, merId, buyer, divId, count, objId, combiType, price, integral, currAmount, cartType) {
        if (cartType == 1003) {
            alert("0折抢购商品只能够买一个！");
            jQuery("#amount" + itemId).val(1);
            return false;
        }
        var amount = jQuery("#amount" + cartItemId);
        if (amount.val() > 1) {
            amount.val(Number(amount.val()) - 1);
            updateAmount(cartItemId, amount.val(), merId, buyer, "amount" + cartItemId, divId, count, objId, combiType,
                price, integral, currAmount, cartType);
        }
    }

    function addamount(cartItemId, merId, buyer, divId, count, objId, combiType, price, integral, currAmount, cartType) {
        if (cartType == 1003) {
            alert("0折抢购商品只能够买一个！");
            jQuery("#amount" + itemId).val(1);
            return false;
        }
        var amount = jQuery("#amount" + cartItemId);

        if (combiType == 1) {
            amount.val(Number(amount.val()) + 1);
            updateAmount(cartItemId, amount.val(), merId, buyer, "amount" + cartItemId, divId, count, objId, combiType,
                price, integral, currAmount);
        } else {
            amount.val(Number(amount.val()) + 1);
            updateAmount(cartItemId, amount.val(), merId, buyer, "amount" + cartItemId, divId, count, objId, combiType,
                price, integral, currAmount);
        }
    }

    function updateAmount(itemId, newAmount, merId, buyer, elemId, divId, count, objId, combiType, price, integral,
                          currAmount, cartType) {
        if (isNaN(newAmount) || newAmount <= 0) {
            alert("请输入正确的商品数量！");
            jQuery("#amount" + itemId).val(1);
            return false;
        } else if (cartType == 1003) {
            alert("0折抢购商品只能够买一个！");
            jQuery("#amount" + itemId).val(1);
            return false;
        } else {
            var amount = jQuery("#amount" + itemId);
            var params = new Object();
            params["randomT"] = Math.random();
            params["itemId"] = itemId;
            params["newAmount"] = newAmount;
            params["merId"] = merId;
            params["buyer"] = buyer;
            params["elemId"] = elemId;
            jQuery.post("/Cart/UpdateAmounForjQuery.do", params, function(data) {
                onUpdateSuccess(data, elemId, itemId, count, objId, newAmount, combiType, price, divId,
                    integral);
            });
        }
    }

    function onUpdateSuccess(StringData, elemId, itemId, count, objId, newAmount, combiType, price, divId, integral) {
        jQuery.ajaxSettings['contentType'] = "application/x-www-form-urlencoded; charset=utf-8";
        jQuery.post("/Cart/hasMoneyPresent.do", function(data) {
            jQuery("#hasMoneyPresentDiv").html(data);
        });
        jQuery.post("/Cart/hasPresentByCount.do", {
            objId: objId,
            objType: combiType,
            itemId: itemId,
            count: newAmount
        }, function(data) {
            jQuery("#selectPresent").html(data);
        });
        jQuery("#cardPromts").load("/Cart/hasCardPrompts.do", StringData);
        var data = StringData.split("---");
        if (data.length == 1) {
            alert(data[0]);
            window.location.reload();
        }
        if (data.length == 2) {
            alert(jQuery.trim(data[0]));
            window.location.reload();
        } else if (data.length == 7) {
            var paramsForCookie = new Object();
            paramsForCookie["itemId"] = itemId;
            paramsForCookie["newAmount"] = data[1];
            jQuery.post("/Cart/changeGoodsAmountForCookie.do", paramsForCookie, function() {});
            if (data[5]) {

                var datas = data[5].split(':');
                if (datas[0] == 1002) {
                    if (parseInt(datas[2]) > parseInt(datas[1])) {
                        jQuery("#amount" + itemId).val(datas[1]);
                        alert('抢购商品每次最大的购买数为' + datas[1] + "件");
                        return;
                    }
                }
            }

            jQuery("#numtotalprice" + itemId).html(data[2]);
            jQuery("#totalPrice").html(data[2]);
            jQuery("#totalPrice4").html(data[2]);
            jQuery("#totalSavePrice").html(data[3]);
            jQuery.post("/Cart/TotalNeddPayIntegral.do", function(data) {
                jQuery("#totalIntegral").html(data);
            });
            var price1 = "50.00";
            var price2 = data[2].replace("￥", "");
            var allPrice = parseFloat(price1) - parseFloat(price2);
            showDelAllCart(divId, itemId);
            if (combiType == 1) {
                var data2 = new Object();
                data2["articleId"] = objId;
                data2["cartItemAmount"] = newAmount;
                jQuery.ajaxSettings['contentType'] = "application/x-www-form-urlencoded; charset=utf-8";
                jQuery("#bomobjectDiv").load("/IncludeAmount.jsp", data2);

            }
        }
    }

    function showDelAllCart(id, index) {
        jQuery("#" + id + index).slideToggle("fast");
        if (id == "num") {
        }
        setTimeout(function() {
            jQuery('#' + id + index).hide();
        }, 3000);
    }

    function readCookie(name) {
        var cookieValue = "";
        var search = name + "=";
        if (document.cookie.length > 0) {
            offset = document.cookie.indexOf(search);
            if (offset != -1) {
                offset += search.length;
                end = document.cookie.indexOf(";", offset);
                if (end == -1) end = document.cookie.length;
                cookieValue = unescape(document.cookie.substring(offset, end))
            }
        }
        return cookieValue;
    }

    function goBackUrl() {
        var goBackUrl = readCookie("ShoppingCartGoBack");
        if (goBackUrl == "") {
            location.href = "/?mid=0";
        } else {
            location.href = goBackUrl;
        }
    }

    // 格式化保留两位小数
    function FormatNumber(srcStr, nAfterDot) {
        var srcStr, nAfterDot;
        var resultStr, nTen;
        srcStr = "" + srcStr + "";
        strLen = srcStr.length;
        dotPos = srcStr.indexOf(".", 0);
        if (dotPos == -1) {
            resultStr = srcStr + ".";
            for (i = 0; i < nAfterDot; i++) {
                resultStr = resultStr + "0";
            }
            return resultStr;
        } else {
            if ((strLen - dotPos - 1) >= nAfterDot) {
                nAfter = dotPos + nAfterDot + 1;
                nTen = 1;
                for (j = 0; j < nAfterDot; j++) {
                    nTen = nTen * 10;
                }
                resultStr = Math.round(parseFloat(srcStr) * nTen) / nTen;
                return resultStr;
            } else {
                resultStr = srcStr;
                for (i = 0; i < (nAfterDot - strLen + dotPos + 1); i++) {
                    resultStr = resultStr + "0";
                }
                return resultStr;
            }
        }
    }
</script>
<!--购物车页头-->
<div class="header">
    <div class="top">
        <div class="wrappertop">
            <div class="fr">
                您好，欢迎来到广购书城：广州购书中心网上书店！
                <a href="/views/laf_dlym">登录</a>
                <a href="/views/tby_zcym">新用户注册</a>
                <a href="/views/laf_wddd">我的订单</a>
                <a href="http://www.gzbookcenter.com/">企业官网</a>
                <span>400-886-4208</span>
            </div>
            <div class="fl">
                <a onclick="AddFavorite(window.location,document.title)" href="javascript:void(0)">收藏广购书城</a>
                <div class="address">
                    <div class="areamini">送至：<span>广东</span></div>
                    <ul style="display: none">
                        <li><a href="javascript:void(0);">北京</a></li>
                        <li><a href="javascript:void(0);">上海</a></li>
                        <li><a href="javascript:void(0);">天津</a></li>
                        <li><a href="javascript:void(0);">重庆</a></li>
                        <li><a href="javascript:void(0);">河北</a></li>
                        <li><a href="javascript:void(0);">山西</a></li>
                        <li><a href="javascript:void(0);">河南</a></li>
                        <li><a href="javascript:void(0);">辽宁</a></li>
                        <li><a href="javascript:void(0);">吉林</a></li>
                        <li><a href="javascript:void(0);">黑龙江</a></li>
                        <li><a href="javascript:void(0);">内蒙古</a></li>
                        <li><a href="javascript:void(0);">江苏</a></li>
                        <li><a href="javascript:void(0);">山东</a></li>
                        <li><a href="javascript:void(0);">安徽</a></li>
                        <li><a href="javascript:void(0);">浙江</a></li>
                        <li><a href="javascript:void(0);">福建</a></li>
                        <li><a href="javascript:void(0);">湖北</a></li>
                        <li><a href="javascript:void(0);">湖南</a></li>
                        <li><a href="javascript:void(0);" class="selected">广东</a></li>
                        <li><a href="javascript:void(0);">广西</a></li>
                        <li><a href="javascript:void(0);">江西</a></li>
                        <li><a href="javascript:void(0);">四川</a></li>
                        <li><a href="javascript:void(0);">海南</a></li>
                        <li><a href="javascript:void(0);">贵州</a></li>
                        <li><a href="javascript:void(0);">云南</a></li>
                        <li><a href="javascript:void(0);">西藏</a></li>
                        <li><a href="javascript:void(0);">陕西</a></li>
                        <li><a href="javascript:void(0);">甘肃</a></li>
                        <li><a href="javascript:void(0);">青海</a></li>
                        <li><a href="javascript:void(0);">宁夏</a></li>
                        <li><a href="javascript:void(0);">新疆</a></li>
                        <li><a href="javascript:void(0);">台湾</a></li>
                        <li><a href="javascript:void(0);">香港</a></li>
                        <li><a href="javascript:void(0);">澳门</a></li>
                        <li><a href="javascript:void(0);">钓鱼岛</a></li>
                        <li><a href="javascript:void(0);">海外</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom wrapper">
        <div class="clear"></div>
        <h1>
            <a href="#" target="_blank">
                <img src="/hyt/img/20170823044910724.jpg" width="280" height="30" alt="广购书城"
                     border="0">
            </a>
        </h1>
        <div class="search" style="text-align:right;margin-top:20px;">
            <form  id="searchform" name="searchform" style="margin:0" action="#">
                <input type="hidden" id="thKeywords" name="Keywords">
                <input id="topKeywords" type="text" value="贫穷的本质"
                       onfocus="if (value =='贫穷的本质'){value =''};this.style.color='#000'">
                <input type="submit" value="">
            </form>
        </div>
        <div class="clear"></div>
    </div>
</div>
<!--end 购物车页头-->
<div class="buyCar wrapper">
    <font color="red">注意：购物车商品一次只能装约30左右商品，如果商品大于30只请分开下单！谢谢！</font>
    <div class="path">
        <ul>
            <li class="cur">
                <span style="background-image:url(/hyt/img/carPath1.png);"></span>我的购物车<i></i>
            </li>
            <li>
                <span style="background-image:url(/hyt/img/carPath2.png);"></span>确认订单信息<i></i>
            </li>
            <li>
                <span style="background-image:url(/hyt/img/carPath3.png);"></span>成功提交订单<i></i>
            </li>
        </ul>
    </div>
    <div class="no-record">
        <p>您的购物车还是空的,快快行动吧!您可以:</p>
        <div>
            <a href="/views/laf_dlym">登录</a>
            <a href="/views/yjy_xsys">去购物</a>
        </div>
    </div>
</div>
<div id="rightDiv" style="Z-INDEX: 10; right: 2px; VISIBILITY: visible; WIDTH: 180px; POSITION: fixed; TOP: 210px; HEIGHT: 160px">
    <table id="index_09_left_servicehotline" width="160px" border="0" align="center" cellpadding="2" cellspacing="0">
        <tbody><tr>
            <td class="customer">
                <div class="customer_service">
                    <a target="_blank" href="#">
                        <img border="0" src="/hyt/img/QQtalk.png" alt="点击这里给我发消息" title="点击这里给我发消息">&nbsp; 客服
                    </a>
                </div>
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
        </tr>
        <tr class="time">
            <td height="15px" class="index_09_left_servicehotline_h2 time">
                <img style="padding-left: 5px;" src="/hyt/img/QQtalk1.png" alt="">
                400-886-4208
            </td>
        </tr>
        <tr class="time">
            <td height="25px" class="service_time">
                <img src="/hyt/img/QQtalk3.png" alt="">
                服务时间：9:00-20:30</td>
        </tr>
        <tr>
            <td><a href="#">
                <div style="border: 5px solid white;">
                    <img width="150" height="160"
                         src="/hyt/img/20190929051242132.jpg" alt="">
                </div>
            </a></td>
        </tr>
        </tbody></table>
</div>
<!--购物车页尾-->
<div id="cart_footer">
    <!-- 页脚 added by alex 0819-->
    <style type="text/css">
        #myfooter{text-align: center;margin:20px 0;}
        #myfooter a:link,#myfooter a:visited{color:#333;text-decoration:none; }
        #myfooter a:hover{color:#c00;text-decoration:underline;}
        #myfooter a:active{color:#900;}
    </style>
    <div id="myfooter"><!-- 友情链接-->
        <div style="text-align: center; margin: 15px 0 10px">友情链接：
            <a target="_blank" href="http://www.gzxhcbfx.com/">广州新华出版发行集团</a>&nbsp;|
            <a href="http://www.gzsxhsd.com/" target="_blank" style="color: rgb(72, 72, 72); font-family: 微软雅黑, arial; text-align: left;">广州市新华书店集团有限公司&nbsp;</a>
            <span style="color: rgb(110, 110, 110); font-family: 微软雅黑, arial; text-align: left;">|&nbsp;</span>
            <a href="http://www.gzcbs.com.cn/company.asp" target="_blank" style="color: rgb(72, 72, 72); font-family: 微软雅黑, arial; text-align: left;">广州出版社有限公司</a>
            <span style="color: rgb(110, 110, 110); font-family: 微软雅黑, arial; text-align: left;">&nbsp;|</span>
            <a href="http://www.gzbkt.com/" target="_blank" style="color: rgb(72, 72, 72); font-family: 微软雅黑, arial; text-align: left;" se_prerender_url="complete">&nbsp;广州报刊亭有限公司</a>
        </div>
        <div style="text-align: center; margin: 15px 0px 10px">&nbsp;&nbsp;</div>
        <div>
            <a rel="nofollow" href="http://www.gg1994.com/Info/ShowInfo.do?id=898309">关于网站</a> |
            <a rel="nofollow" href="http://www.gg1994.com/Info/ShowInfo.do?id=898311">公司简介</a>
            <!--|  <a href='#'>其他服务</a>  |  <a href='#'>购物指南</a>  -->|
            <a rel="nofollow" href="http://www.gg1994.com/Info/ShowInfo.do?id=898312">法律声明</a> |
            <a rel="nofollow" href="http://www.gg1994.com/Info/ShowInfo.do?id=898313">联系我们</a>
            <!--|  <a href='#'>购物演示</a>-->
        </div>
        <div style="text-align: center; margin: 15px 0px 5px">广州购书中心有限公司 版权所有&#169; 2010 经营许可证：粤B2-20040295
            <a rel="nofollow" target="_blank" href="https://beian.miit.gov.cn/#/Integrated/index" se_prerender_url="loading">粤ICP备10095868号</a>
        </div>
        <!--可信网站图片LOGO安装开始-->
        <a rel="nofollow" href="https://ss.knet.cn/verifyseal.dll?sn=2010122200100003455 ct=df pa=328989">
            <img alt="" src="/hyt/img/seallogo.png"></a>
        <img alt="" src="/hyt/img/footer_img.gif">
        <a rel="nofollow" target="_blank" href="/hyt/img/ktjc.gif">
            <img alt="" style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" src="/hyt/img/ktjc.gif">
        </a>
        <a href="http://www.gg1994.com/" target="_blank">
            <img border="0" alt="" src="hyt/img/startimg.jpg">
            <img alt="" src="/hyt/img/dyh.jpg">
            <img alt="" width="100" hight="100px" style="margin-left: 10px" src="/hyt/img/fwh.jpg">
        </a>
    </div>
</div>
</body>
</html>